<template>
  <div>
    <el-form-item label="入库渠道" label-width="150px" class="normal-type">
      <el-select v-model="$store.state.edit.row.sensitiveWordsInstockChannelId" size="mini" filterable clearable multiple style="width: 80%;">
        <el-option v-for="(item, value) in channelSourceMap.customerChannelMap" :key="value" :label="item" :value="parseInt(value)"></el-option>
      </el-select>
      <div>
        <el-tag type="info" size="mini" v-for="(item,value) in selectMap" :key="value" :label="item" style="margin-right:10px" @click="selectChannel(value)">{{item}}</el-tag>
      </div>
    </el-form-item>
  </div>
</template>

<script>
  import {ajax} from "@/store/yg/common/utils";
export default {
  props: ["data"],
  data() {
    return {
      channelSourceMap: {},
      selectMap: { '1': '空运', '2': '海运', '3': '快递', '4': '全选','5': '全不选'}
    }
  },
  mounted() {
    this.init();
  },
  methods: {
    async init() {
      this.channelSourceMap = await ajax('getCustomerChannelSource', {});
    },
    selectChannel(op){
      const channelIds = this.channelSourceMap[op];
      this.$store.state.edit.row.sensitiveWordsInstockChannelId = channelIds;
    }
  }
}
</script>
